<template>
	<view class="top-bar">
		<view class="status_bar" :style="{height:statusBarHeight}">
		          <!-- 这里是状态栏 -->
		</view>
		<view class="bar-wrap">
			<view class="bar-left" :style="{color:color}">
				<view @click="fnNavBackClick" class="i-left-arrow">
					<vs-icon type="icon-zuojiantou" size="20"></vs-icon>
				</view>
				<view class="i-left-title">
					{{title}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcon from '../uni-icons/uni-icons.vue'
	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
	export default {
		components:{
		uniIcon
			
		},
		props:{
			title:{
				type:String,
				default:'标题777'
			},
			color:{
				default:'#303030'
			}
		},
		data() {
			return {
				statusBarHeight:statusBarHeight
			}
		},
		methods:{
			fnNavBackClick(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	.top-bar{
		width: 100%;
		//height:43px ;
		display: flex;
		flex-direction: column;
		//background-color: #007AFF;
		
		.status_bar {
		      height: var(--status-bar-height);
		      width: 100%;
			 // background-color: #4CD964;
		  }
		.bar-wrap{
			width: 100%;
			height: 43px;
			//background-color: #2C405A;
			display: flex;
			align-items: center;
			
			.bar-left{
				margin-left: 5px;
				display: flex;
				.i-left-arrow{
					width: 30px;
					height: 30px;
					display: flex;
					align-items: center;
					//justify-content: center;
				//	background-color: #4CD964;
				}
				.i-left-title{
					// width: 30px;
					// height: 30px;
					font-size: 14px;
					display: flex;
					align-items: center;
					justify-content: center;
					//background-color: #d1d97b;
				}
			}
		}
	}

</style>
